{% extends 'base.html' %}
{% load staticfiles %}

{% block content %}

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        {%if msg%}
        <div class="alert alert-success">
            <strong>{{msg}}</strong>
        </div>
        {%endif%}
    <h2 class="page-header">修改信息</h2>
    <div>
        <form class="form-horizontal" method="POST" action="/staff/edit?id={{staff.id}}">
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="username" id="inputEmail3" value={{staff.username}}>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
                <div class="col-sm-5">
                    <input type="email" class="form-control" name="email" id="inputEmail3" value={{staff.email}}>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">手机号</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="mobile" id="inputEmail3" value={{staff.mobile}}>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">身份证号</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="id_card" id="inputEmail3" value={{staff.id_card}}>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">年龄</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="age" id="inputEmail3" value={{staff.age}}>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">职位</label>
                <div class="col-sm-5">
                    <select class="form-control" name='type' id="staff-type">
                        <option value="0" {%if staff.type == 0%}selected = "selected"{%endif%}>系统管理员</option>
                        <option value="1" {%if staff.type == 1%}selected = "selected"{%endif%}>经理</option>
                        <option value="2" {%if staff.type == 2%}selected = "selected"{%endif%}>收银员</option>
                        <option value="4" {%if staff.type == 4%}selected = "selected"{%endif%}>保洁员</option>
                        <option value="5" {%if staff.type == 5%}selected = "selected"{%endif%}>维修工人</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">性别</label>
                <div class="col-sm-5">
                    <label class="radio-inline">
                        <input type="radio" name="gender" id="inlineRadio1" value="male" {%if staff.gender == 'male'%}checked="checked"{%endif%}>男
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="gender" id="inlineRadio2" value="female" {%if staff.gender == 'female'%}checked="checked"{%endif%}>女
                    </label>
                </div>
            </div>
            <input type="hidden" name="id" value="{{staff.id}}">
            {% csrf_token %}
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-2">
                    <button type="submit" class="btn btn-primary">修改</button>
                </div>
            </div>
        </form>

    </div>
</div>


{% endblock %}